package org.demo.base.config;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
public class RegisterInterceptorConfig implements WebMvcConfigurer {

	/**
	 * 重写添加拦截器方法并添加配置拦截器
	 * 
	 * @param registry Register
	 */
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new AuthInterceptor()).addPathPatterns("/api/v1/**")
				.excludePathPatterns("/api/v1/hcconsume/**").excludePathPatterns("/api/v1/hcsynctable/**")
				.excludePathPatterns("/api/v1/hccommand/**");
	}
}